package com.lovehena.controller;

import com.lovehena.entity.Area;
import com.lovehena.service.AreaServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/area")
public class AreaController {



    @Autowired
    private AreaServiceImpl areaService;

    @GetMapping("/tree")
    public List<Area> getTree(){
        List<Area> tree = areaService.getAreas();
        return tree;
    }
}
